﻿#if USE_UNI_LUA
using LuaAPI = UniLua.Lua;
using RealStatePtr = UniLua.ILuaState;
using LuaCSFunction = UniLua.CSharpFunctionDelegate;
#else
using LuaAPI = XLua.LuaDLL.Lua;
using RealStatePtr = System.IntPtr;
using LuaCSFunction = XLuaBase.lua_CSFunction;
#endif

using XLua;
using System.Collections.Generic;


namespace XLua.CSObjectWrap
{
    using Utils = XLua.Utils;
    public class SceneObjectLoadControllerWrap 
    {
        public static void __Register(RealStatePtr L)
        {
			ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
			System.Type type = typeof(SceneObjectLoadController);
			Utils.BeginObjectRegister(type, L, translator, 0, 11, 2, 2);
			
			Utils.RegisterFunc(L, Utils.METHOD_IDX, "Init", _m_Init);
			Utils.RegisterFunc(L, Utils.METHOD_IDX, "SetLoadObjectActive", _m_SetLoadObjectActive);
			Utils.RegisterFunc(L, Utils.METHOD_IDX, "AddSceneBlockObject", _m_AddSceneBlockObject);
			Utils.RegisterFunc(L, Utils.METHOD_IDX, "RefreshDetectorImmediately", _m_RefreshDetectorImmediately);
			Utils.RegisterFunc(L, Utils.METHOD_IDX, "RefreshDetector", _m_RefreshDetector);
			Utils.RegisterFunc(L, Utils.METHOD_IDX, "DestroyBirthPointObj", _m_DestroyBirthPointObj);
			Utils.RegisterFunc(L, Utils.METHOD_IDX, "DestroyObject", _m_DestroyObject);
			Utils.RegisterFunc(L, Utils.METHOD_IDX, "CrashObject", _m_CrashObject);
			Utils.RegisterFunc(L, Utils.METHOD_IDX, "SetLoadCompleteLuaFunction", _m_SetLoadCompleteLuaFunction);
			Utils.RegisterFunc(L, Utils.METHOD_IDX, "UnloadAllDynamicObjects", _m_UnloadAllDynamicObjects);
			Utils.RegisterFunc(L, Utils.METHOD_IDX, "SetSync", _m_SetSync);
			
			
			Utils.RegisterFunc(L, Utils.GETTER_IDX, "AsynCount", _g_get_AsynCount);
            Utils.RegisterFunc(L, Utils.GETTER_IDX, "loadCompleteLuaFunction", _g_get_loadCompleteLuaFunction);
            
			Utils.RegisterFunc(L, Utils.SETTER_IDX, "AsynCount", _s_set_AsynCount);
            Utils.RegisterFunc(L, Utils.SETTER_IDX, "loadCompleteLuaFunction", _s_set_loadCompleteLuaFunction);
            
			
			Utils.EndObjectRegister(type, L, translator, null, null,
			    null, null, null);

		    Utils.BeginClassRegister(type, L, __CreateInstance, 1, 0, 0);
			
			
            
			
			
			
            Utils.RegisterFunc(L, Utils.CLS_IDX, "New", __CreateInstanceNew);
			Utils.EndClassRegister(type, L, translator);
        }
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int __CreateInstance(RealStatePtr L)
        {
            
			try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
				if(LuaAPI.lua_gettop(L) == 1)
				{
					
					var gen_ret = new SceneObjectLoadController();
					translator.Push(L, gen_ret);
                    
					return 1;
				}
				
			}
			catch(System.Exception gen_e) {
				return LuaAPI.luaL_error(L, $"c# exception: {gen_e}\n{Yoozoo.Framework.Managers.LuaManager.GetTraceBack()}");
			}
            return LuaAPI.luaL_error(L, "invalid arguments to SceneObjectLoadController constructor!");
            
        }

        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int __CreateInstanceNew(RealStatePtr L)
        {
            
			try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
				if(LuaAPI.lua_gettop(L) == 0)
				{
					
					var gen_ret = new SceneObjectLoadController();
					translator.Push(L, gen_ret);
                    
					return 1;
				}
				
			}
			catch(System.Exception gen_e) {
				return LuaAPI.luaL_error(L, $"c# exception: {gen_e}\n{Yoozoo.Framework.Managers.LuaManager.GetTraceBack()}");
			}
            return LuaAPI.luaL_error(L, "invalid arguments to SceneObjectLoadController constructor!");
            
        }

        
		
        
		
        
        
        
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _m_Init(RealStatePtr L)
        {
		    try {
            
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
            
            
                SceneObjectLoadController gen_to_be_invoked = (SceneObjectLoadController)translator.FastGetCSObj(L, 1);
            
            
			    int gen_param_count = LuaAPI.lua_gettop(L);
            
                if(gen_param_count == 5&& translator.Assignable<UnityEngine.Vector3>(L, 2)&& translator.Assignable<UnityEngine.Vector3>(L, 3)&& LuaTypes.LUA_TBOOLEAN == LuaAPI.lua_type(L, 4)&& translator.Assignable<TreeType>(L, 5)) 
                {
                    UnityEngine.Vector3 _center;translator.Get(L, 2, out _center);
                    UnityEngine.Vector3 _size;translator.Get(L, 3, out _size);
                    bool _asyn = LuaAPI.lua_toboolean(L, 4);
                    TreeType _treeType;translator.Get(L, 5, out _treeType);
                    
                    gen_to_be_invoked.Init( _center, _size, _asyn, _treeType );
                    
                    
                    
                    return 0;
                }
                if(gen_param_count == 7&& translator.Assignable<UnityEngine.Vector3>(L, 2)&& translator.Assignable<UnityEngine.Vector3>(L, 3)&& LuaTypes.LUA_TBOOLEAN == LuaAPI.lua_type(L, 4)&& LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 5)&& LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 6)&& translator.Assignable<TreeType>(L, 7)) 
                {
                    UnityEngine.Vector3 _center;translator.Get(L, 2, out _center);
                    UnityEngine.Vector3 _size;translator.Get(L, 3, out _size);
                    bool _asyn = LuaAPI.lua_toboolean(L, 4);
                    int _maxCreateCount = LuaAPI.xlua_tointeger(L, 5);
                    int _minCreateCount = LuaAPI.xlua_tointeger(L, 6);
                    TreeType _treeType;translator.Get(L, 7, out _treeType);
                    
                    gen_to_be_invoked.Init( _center, _size, _asyn, _maxCreateCount, _minCreateCount, _treeType );
                    
                    
                    
                    return 0;
                }
                if(gen_param_count == 10&& translator.Assignable<UnityEngine.Vector3>(L, 2)&& translator.Assignable<UnityEngine.Vector3>(L, 3)&& LuaTypes.LUA_TBOOLEAN == LuaAPI.lua_type(L, 4)&& LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 5)&& LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 6)&& LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 7)&& LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 8)&& translator.Assignable<TreeType>(L, 9)&& LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 10)) 
                {
                    UnityEngine.Vector3 _center;translator.Get(L, 2, out _center);
                    UnityEngine.Vector3 _size;translator.Get(L, 3, out _size);
                    bool _asyn = LuaAPI.lua_toboolean(L, 4);
                    int _maxCreateCount = LuaAPI.xlua_tointeger(L, 5);
                    int _minCreateCount = LuaAPI.xlua_tointeger(L, 6);
                    float _maxRefreshTime = (float)LuaAPI.lua_tonumber(L, 7);
                    float _maxDestroyTime = (float)LuaAPI.lua_tonumber(L, 8);
                    TreeType _treeType;translator.Get(L, 9, out _treeType);
                    int _quadTreeDepth = LuaAPI.xlua_tointeger(L, 10);
                    
                    gen_to_be_invoked.Init( _center, _size, _asyn, _maxCreateCount, _minCreateCount, _maxRefreshTime, _maxDestroyTime, _treeType, _quadTreeDepth );
                    
                    
                    
                    return 0;
                }
                if(gen_param_count == 9&& translator.Assignable<UnityEngine.Vector3>(L, 2)&& translator.Assignable<UnityEngine.Vector3>(L, 3)&& LuaTypes.LUA_TBOOLEAN == LuaAPI.lua_type(L, 4)&& LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 5)&& LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 6)&& LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 7)&& LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 8)&& translator.Assignable<TreeType>(L, 9)) 
                {
                    UnityEngine.Vector3 _center;translator.Get(L, 2, out _center);
                    UnityEngine.Vector3 _size;translator.Get(L, 3, out _size);
                    bool _asyn = LuaAPI.lua_toboolean(L, 4);
                    int _maxCreateCount = LuaAPI.xlua_tointeger(L, 5);
                    int _minCreateCount = LuaAPI.xlua_tointeger(L, 6);
                    float _maxRefreshTime = (float)LuaAPI.lua_tonumber(L, 7);
                    float _maxDestroyTime = (float)LuaAPI.lua_tonumber(L, 8);
                    TreeType _treeType;translator.Get(L, 9, out _treeType);
                    
                    gen_to_be_invoked.Init( _center, _size, _asyn, _maxCreateCount, _minCreateCount, _maxRefreshTime, _maxDestroyTime, _treeType );
                    
                    
                    
                    return 0;
                }
                
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, $"c# exception: {gen_e}\n{Yoozoo.Framework.Managers.LuaManager.GetTraceBack()}");
            }
            
            return LuaAPI.luaL_error(L, "invalid arguments to SceneObjectLoadController.Init!");
            
        }
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _m_SetLoadObjectActive(RealStatePtr L)
        {
		    try {
            
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
            
            
                SceneObjectLoadController gen_to_be_invoked = (SceneObjectLoadController)translator.FastGetCSObj(L, 1);
            
            
                
                {
                    bool _active = LuaAPI.lua_toboolean(L, 2);
                    
                    gen_to_be_invoked.SetLoadObjectActive( _active );
                    
                    
                    
                    return 0;
                }
                
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, $"c# exception: {gen_e}\n{Yoozoo.Framework.Managers.LuaManager.GetTraceBack()}");
            }
            
        }
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _m_AddSceneBlockObject(RealStatePtr L)
        {
		    try {
            
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
            
            
                SceneObjectLoadController gen_to_be_invoked = (SceneObjectLoadController)translator.FastGetCSObj(L, 1);
            
            
                
                {
                    ISceneObject _obj = (ISceneObject)translator.GetObject(L, 2, typeof(ISceneObject));
                    
                    gen_to_be_invoked.AddSceneBlockObject( _obj );
                    
                    
                    
                    return 0;
                }
                
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, $"c# exception: {gen_e}\n{Yoozoo.Framework.Managers.LuaManager.GetTraceBack()}");
            }
            
        }
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _m_RefreshDetectorImmediately(RealStatePtr L)
        {
		    try {
            
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
            
            
                SceneObjectLoadController gen_to_be_invoked = (SceneObjectLoadController)translator.FastGetCSObj(L, 1);
            
            
                
                {
                    IDetector _detector = (IDetector)translator.GetObject(L, 2, typeof(IDetector));
                    
                    gen_to_be_invoked.RefreshDetectorImmediately( _detector );
                    
                    
                    
                    return 0;
                }
                
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, $"c# exception: {gen_e}\n{Yoozoo.Framework.Managers.LuaManager.GetTraceBack()}");
            }
            
        }
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _m_RefreshDetector(RealStatePtr L)
        {
		    try {
            
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
            
            
                SceneObjectLoadController gen_to_be_invoked = (SceneObjectLoadController)translator.FastGetCSObj(L, 1);
            
            
                
                {
                    IDetector _detector = (IDetector)translator.GetObject(L, 2, typeof(IDetector));
                    
                    gen_to_be_invoked.RefreshDetector( _detector );
                    
                    
                    
                    return 0;
                }
                
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, $"c# exception: {gen_e}\n{Yoozoo.Framework.Managers.LuaManager.GetTraceBack()}");
            }
            
        }
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _m_DestroyBirthPointObj(RealStatePtr L)
        {
		    try {
            
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
            
            
                SceneObjectLoadController gen_to_be_invoked = (SceneObjectLoadController)translator.FastGetCSObj(L, 1);
            
            
                
                {
                    
                    gen_to_be_invoked.DestroyBirthPointObj(  );
                    
                    
                    
                    return 0;
                }
                
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, $"c# exception: {gen_e}\n{Yoozoo.Framework.Managers.LuaManager.GetTraceBack()}");
            }
            
        }
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _m_DestroyObject(RealStatePtr L)
        {
		    try {
            
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
            
            
                SceneObjectLoadController gen_to_be_invoked = (SceneObjectLoadController)translator.FastGetCSObj(L, 1);
            
            
                
                {
                    SceneObject _obj = (SceneObject)translator.GetObject(L, 2, typeof(SceneObject));
                    bool _asyn = LuaAPI.lua_toboolean(L, 3);
                    
                    gen_to_be_invoked.DestroyObject( _obj, _asyn );
                    
                    
                    
                    return 0;
                }
                
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, $"c# exception: {gen_e}\n{Yoozoo.Framework.Managers.LuaManager.GetTraceBack()}");
            }
            
        }
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _m_CrashObject(RealStatePtr L)
        {
		    try {
            
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
            
            
                SceneObjectLoadController gen_to_be_invoked = (SceneObjectLoadController)translator.FastGetCSObj(L, 1);
            
            
                
                {
                    SceneObject _obj = (SceneObject)translator.GetObject(L, 2, typeof(SceneObject));
                    bool _asyn = LuaAPI.lua_toboolean(L, 3);
                    
                    gen_to_be_invoked.CrashObject( _obj, _asyn );
                    
                    
                    
                    return 0;
                }
                
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, $"c# exception: {gen_e}\n{Yoozoo.Framework.Managers.LuaManager.GetTraceBack()}");
            }
            
        }
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _m_SetLoadCompleteLuaFunction(RealStatePtr L)
        {
		    try {
            
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
            
            
                SceneObjectLoadController gen_to_be_invoked = (SceneObjectLoadController)translator.FastGetCSObj(L, 1);
            
            
                
                {
                    XLua.LuaFunction _luaFunction = (XLua.LuaFunction)translator.GetObject(L, 2, typeof(XLua.LuaFunction));
                    
                    gen_to_be_invoked.SetLoadCompleteLuaFunction( _luaFunction );
                    
                    
                    
                    return 0;
                }
                
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, $"c# exception: {gen_e}\n{Yoozoo.Framework.Managers.LuaManager.GetTraceBack()}");
            }
            
        }
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _m_UnloadAllDynamicObjects(RealStatePtr L)
        {
		    try {
            
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
            
            
                SceneObjectLoadController gen_to_be_invoked = (SceneObjectLoadController)translator.FastGetCSObj(L, 1);
            
            
                
                {
                    
                    gen_to_be_invoked.UnloadAllDynamicObjects(  );
                    
                    
                    
                    return 0;
                }
                
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, $"c# exception: {gen_e}\n{Yoozoo.Framework.Managers.LuaManager.GetTraceBack()}");
            }
            
        }
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _m_SetSync(RealStatePtr L)
        {
		    try {
            
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
            
            
                SceneObjectLoadController gen_to_be_invoked = (SceneObjectLoadController)translator.FastGetCSObj(L, 1);
            
            
                
                {
                    bool _sync = LuaAPI.lua_toboolean(L, 2);
                    
                    gen_to_be_invoked.SetSync( _sync );
                    
                    
                    
                    return 0;
                }
                
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, $"c# exception: {gen_e}\n{Yoozoo.Framework.Managers.LuaManager.GetTraceBack()}");
            }
            
        }
        
        
        
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _g_get_AsynCount(RealStatePtr L)
        {
		    try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
			
                SceneObjectLoadController gen_to_be_invoked = (SceneObjectLoadController)translator.FastGetCSObj(L, 1);
                LuaAPI.xlua_pushinteger(L, gen_to_be_invoked.AsynCount);
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, $"c# exception: {gen_e}\n{Yoozoo.Framework.Managers.LuaManager.GetTraceBack()}");
            }
            return 1;
        }
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _g_get_loadCompleteLuaFunction(RealStatePtr L)
        {
		    try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
			
                SceneObjectLoadController gen_to_be_invoked = (SceneObjectLoadController)translator.FastGetCSObj(L, 1);
                translator.Push(L, gen_to_be_invoked.loadCompleteLuaFunction);
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, $"c# exception: {gen_e}\n{Yoozoo.Framework.Managers.LuaManager.GetTraceBack()}");
            }
            return 1;
        }
        
        
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _s_set_AsynCount(RealStatePtr L)
        {
		    try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
			
                SceneObjectLoadController gen_to_be_invoked = (SceneObjectLoadController)translator.FastGetCSObj(L, 1);
                gen_to_be_invoked.AsynCount = LuaAPI.xlua_tointeger(L, 2);
            
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, $"c# exception: {gen_e}\n{Yoozoo.Framework.Managers.LuaManager.GetTraceBack()}");
            }
            return 0;
        }
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _s_set_loadCompleteLuaFunction(RealStatePtr L)
        {
		    try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
			
                SceneObjectLoadController gen_to_be_invoked = (SceneObjectLoadController)translator.FastGetCSObj(L, 1);
                gen_to_be_invoked.loadCompleteLuaFunction = (XLua.LuaFunction)translator.GetObject(L, 2, typeof(XLua.LuaFunction));
            
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, $"c# exception: {gen_e}\n{Yoozoo.Framework.Managers.LuaManager.GetTraceBack()}");
            }
            return 0;
        }
        
		
		
		
		
    }
}
